package com.spacearcade.logic.tester;

import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

import com.spacearcade.common.layers.commands.CommandRequest;
import com.spacearcade.logic.ObjectType;
import com.spacearcade.logic.SpaceObject;
import com.spacearcade.logic.runtime.LogicRunner;

public class TestLogicRunner {
	private LogicRunner logicRunner;

	/**
	 * @param args
	 */
	public void startLogic(LogicRunner logicRunner) {
		//logicRunner = new LogicRunner();
		logicRunner.start();

		Map<String, String> properties = new TreeMap<String, String>();
		
		properties.clear();
		properties.put("type", ObjectType.Ship.name());
		properties.put("x","50");
		properties.put("y","50");
		properties.put("angle","2.0");
		properties.put("speed","4.0");		
		CommandRequest newCreateCommand = CommandRequest.newCreateCommand(new TreeMap<String, String>(properties));
		
		properties.clear();
		properties.put("type", ObjectType.Ship.name());
		properties.put("x","200");
		properties.put("y","300");
		properties.put("angle","4.0");
		properties.put("speed","0.0");
		CommandRequest newCreateCommand2 = CommandRequest.newCreateCommand(new TreeMap<String, String>(properties));
		
		properties.clear();
		properties.put("type", ObjectType.Asteroid.name());
		properties.put("x","200");
		properties.put("y","100");
		properties.put("angle","0.0");
		properties.put("speed","0.0");
		CommandRequest newCreateCommand3 = CommandRequest.newCreateCommand(new TreeMap<String, String>(properties));
		

		logicRunner.pushCommands(newCreateCommand, newCreateCommand2, newCreateCommand3);

	}

	public void stopLogic(LogicRunner logicRunner) {
		// logicRunner.pushCommands((CommandRequest.newDeleteCommand("Model1")));

		// System.out.println(logicRunner.createObjectsView());

		// sleep();

		logicRunner.stop();

	}

}
